<template>
    <div style="width:1200px">
       <!-- <pdf
    ref="pdf"
    src="https://dakaname.oss-cn-hangzhou.aliyuncs.com/file/2018-12-28/1546003237411.pdf">
  </pdf> -->
<div >
      <el-dialog
          :close-on-click-modal="true"
          :visible.sync="dialogVisible"
          :fullscreen="true"
          title="文件预览">
          <div class="agreement_picture" >
            <div class="pdf" style="height:1200px">
              <!-- <pdf // 之前的用PDF插件的方法
                v-for="i in pdf.numPages"
                :key="i"
                :page="i"
                :src="src">
              </pdf> -->
              <iframe src="https://dakaname.oss-cn-hangzhou.aliyuncs.com/file/2018-12-28/1546003237411.pdf" frameborder="0" style="width: 100%; height: 100%"></iframe>
            </div>
          </div>
          <span slot="footer" class="dialog-footer">
            <div class="tip-left transfer">
                <!-- <el-button type="info" @click="dialogVisible=false">不同意</el-button>
              <el-button type="danger" @click="agreeSignFun">同意</el-button> -->
            </div>
          </span>
        </el-dialog>   </div>
  <div
      class="btn-def"
      @click.stop="pdfPrintAll">全部
  </div>
    </div>
</template>
<script type="text/javascript" src="https://tajs.qq.com/stats?sId=66566068" charset="UTF-8"></script>
<script>
import { getcontract } from '@/api/order'
import pdf from 'vue-pdf'
export default {
  name: 'Pdf',
  components: {
    pdf
  },
  data () {
    return {
      dialogVisible: true
    }
  },
  created () {
    const contractId = this.$route.query.id
    console.log(contractId)
    this.getcontractdata(contractId)
  },
  methods: {
    async getcontractdata (id) {
      const res = await getcontract(id)
    },
    pdfPrintAll () {
      this.$refs.pdf.print()
    }
  }
}
</script>
